package org.example.myleet.p1206;

import org.example.myleet.Utils.Assert;

public class Main {
    public static void main(String[] args) {
        Skiplist skiplist = new Skiplist();
        skiplist.add(1);
        skiplist.add(2);
        skiplist.add(3);
        Assert.isTrue(!skiplist.search(0));
        Assert.isTrue(skiplist.search(3));
        skiplist.add(4);
        Assert.isTrue(skiplist.search(1));
        Assert.isTrue(!skiplist.erase(0));
        Assert.isTrue(skiplist.erase(1));
        Assert.isTrue(!skiplist.search(1));
        skiplist.add(1);
        skiplist.add(1);
        Assert.isTrue(skiplist.search(1));
        Assert.isTrue(skiplist.erase(1));
        Assert.isTrue(skiplist.search(1));
        Assert.isTrue(skiplist.erase(1));
        Assert.isTrue(!skiplist.search(1));
    }
}
